using System;
using System.Collections.Generic;

namespace Toon.Models
{
	internal static class RandomExtensions
	{
		public static int D6(this Random random)
		{
			return random.Next(1, 7);
		}

		public static int D3(this Random random)
		{
			return random.Next(1, 4);
		}

		public static T ChooseAndRemove<T>(this Random random, IList<T> list)
		{
			var index = random.Next(list.Count);
			var result = list[index];
			list.RemoveAt(index);
			return result;
		}

		public static T ChooseOne<T>(this Random random, IList<T> list)
		{
			var index = random.Next(list.Count);
			return list[index];
		}
	}
}
